home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 8 / emc110.zip / EMC110.DOC < prev    next >
Text File  |  1987-07-01  |  15KB  |  279 lines

  1.                         EXPANDED MEMORY DISK CACHE 1.10
  2.  
  3.  
  4. 1. Introduction.
  5.  
  6.      EMC110.COM is a program designed to cache IBM-XT/AT hard disks in LIM
  7. (Lotus-Intel-Microsoft) expanded memory; it will not cache floppies, nor will
  8. it cache in DOS memory or AT extended memory.  It should work with any system
  9. which has a LIM-spec expanded memory board and software, a disk system which is
  10. IBM-XT/AT-compatible at the ROM-BIOS level, and NO OTHER STORAGE DEVICES.  If
  11. your system does not clearly fit this description --- in particular, if you
  12. have a hard disk system which exceeds the 32-meg DOS limit, or if you have any
  13. removable-media storage devices other than standard floppies --- you should NOT
  14. use this program without first reading the 'Technical Notes' section below.
  15.  
  16.  
  17. 2. Installing the Cache.
  18.  
  19.      The cache can be installed by typing
  20.  
  21.                               EMC110 [max [min]]
  22.  
  23. at the DOS prompt, where the optional parameters 'max' and 'min' are the
  24. maximum and minimum number of expanded memory pages you wish to use for the
  25. cache (each page is 16K).  If 'max' is not specified it defaults to 512.  The
  26. point of specifying 'max' is to prevent the cache from consuming all available
  27. expanded memory.  If 'min' is not specified it defaults to 1.  The point of
  28. specifying 'min' is to prevent the installation of a cache which is too small
  29. to be effective.  Note that the parameters are positional: if you want to
  30. specify 'min', you must specify 'max' first.
  31.  
  32.      If at least 'min' pages of expanded memory are available, EMC110 installs
  33. itself as a resident program which, subject to the constraint of 'max', uses as
  34. much expanded memory as possible and up to 64K of DOS memory.  Specifically,
  35. the program requires approximately 3K plus 128 bytes per expanded memory page
  36. used.  Thus a 1-meg cache uses about 11K of DOS memory and, if you have enough
  37. expanded memory, a cache of nearly 8 meg should be possible.
  38.  
  39.  
  40. 3. Changing the Cache Size.
  41.  
  42.      If EMC110 is already installed, the cache size can be dynamically changed
  43. by typing
  44.  
  45.                               EMC110 [max [min]]
  46.  
  47. at the DOS prompt, where 'max' and 'min' have the same significance as for the
  48. initial installation.  The result is that the cache is purged, all expanded
  49. memory being used by the cache is released, a new allocation of expanded memory
  50. of the appropriate size is obtained, and the cache is reinitialized.  Since no
  51. reallocation of DOS memory or manipulation of interrupts is involved, the cache
  52. can be resized under circumstances which would not permit removing it and
  53. reinstalling it.  However, since the cache retains its original allocation of
  54. DOS memory, this imposes an additional constraint on the maximum cache size in
  55. addition to 'max' and the amount of expanded memory available: the new size can
  56. never exceed the size of the original installation.
  57.  
  58.  
  59. 4. Disabling the Cache.
  60.  
  61.      If EMC110 is installed, it can be disabled by typing
  62.  
  63.                                    EMC110 X
  64.  
  65. at the DOS prompt.  The result is that the cache is purged, all expanded memory
  66. being used by the cache is released, and subsequent BIOS disk interrupts are
  67. immediately passed on to the prior interrupt handler.  However, the cache
  68. maintains its allocation of DOS memory and its position in the BIOS disk
  69. interrupt chain, so it can be reactivated as described under 'Changing the
  70. Cache Size' above.
  71.  
  72.  
  73. 5. Uninstalling the Cache.
  74.  
  75.      If EMC110 is installed, it may be possible to uninstall it (i.e., remove
  76. it from memory entirely) by typing
  77.  
  78.                                    EMC110 XX
  79. or
  80.                                    EMC110 XXX
  81.  
  82. at the DOS prompt.  The 'XX' variant will complete the uninstallation only if
  83. it can be done without fragmenting DOS memory.  The 'XXX' variant will complete
  84. the uninstallation whenever possible.  If EMC110 was not the last program to
  85. insert itself in the BIOS disk interrupt chain, then the uninstallation will
  86. not be possible.  If the uninstallation is not completed, then the cache will
  87. be left in the disabled state.
  88.  
  89.  
  90. 6. Querying the Cache.
  91.  
  92.      The status of the cache can be determined by typing
  93.  
  94.                                    EMC110 ?
  95.  
  96. at the DOS prompt.  The result, in addition to an identifying banner, will be
  97. the display of either
  98.  
  99.                               Cache not installed
  100. or
  101.                            xx page cache installed.
  102.  
  103. If the cache is installed, but has been disabled or resized to less than its
  104. original installed size, then either
  105.  
  106.                                Cache is disabled
  107. or
  108.                             xx page cache is active
  109.  
  110. will also be displayed.  In addition, if any disk read, disk write, or expanded
  111. memory errors have occurred, further lines will be displayed detailing these
  112. errors.  Note that the error counts are not reset by resizing or disabling the
  113. cache.  Moreover, only errors which arise from disk or expanded memory requests
  114. issued by the cache itself are counted.
  115.  
  116.      The display described above is also produced by all other calls to EMC110
  117. which don't result in removing the cache from memory entirely.  The difference
  118. is that, whereas the other calls result in the cache's being reinitialized, the
  119. '?' variant leaves the cache intact.
  120.  
  121.  
  122. 7. Compatibility with Resident Program Managers.
  123.  
  124.      EMC110 should not be used with any program which claims to be able to
  125. suspend and later reactivate resident programs.  All disk caches work by
  126. keeping copies of disk sectors in memory.  If a cache is suspended and later
  127. reactivated by another program, the cache has no way of knowing that its
  128. contents may no longer be correct.  The results could be disastrous.
  129.  
  130.      EMC110 may also be incompatible with programs which merely uninstall
  131. resident programs.  Such programs presumably work by recording the computer's
  132. state before a resident program is installed, and restore that state when
  133. uninstalling it.  If you use such a program to uninstall EMC110, or if you
  134. never use EMC110 to resize, disable or uninstall itself, this technique should
  135. work.  But consider the following scenario: first you install EMC110, then you
  136. install resident program 'A', then you disable EMC110, then you install
  137. resident program 'B' which allocates some expanded memory, then you reactivate
  138. EMC110.  At this point the expanded memory owned by EMC110 is probably not the
  139. same as it was when 'A' was installed, so simply removing 'A' and 'B' from
  140. memory and restoring the computer's state to what it was when 'A' was installed
  141. will not work.  Admittedly this scenario is unlikely, and some resident program
  142. managers may even be clever enough to cope with it, but the integrity of your
  143. hard disk is at stake.  If want to use both EMC110 and a resident program
  144. manager, the safe way is never to use EMC110 to resize, disable or uninstall
  145. itself.
  146.  
  147.  
  148. 8. Compatibility with Multitasking Programs.
  149.  
  150.      EMC110 doesn't work with DoubleDOS 4.0.  It does appear to work with both
  151. Microsoft Windows 1.03 and Desqview 1.3 and 2.0.  In fact the resize and
  152. disable features work in a Desqview window.  But note that EMC110 must be
  153. installed BEFORE you invoke Windows or Desqview; you should NEVER install
  154. EMC110 in a window.
  155.  
  156.  
  157. 9. Operational Notes.
  158.  
  159.      EMC110 is a pure write-through cache.  Both reads and writes are cached in
  160. the sense that, whenever an actual disk read or write occurs, copies of the
  161. sectors involved are placed in the cache.  But whereas read requests are
  162. serviced from the cache contents rather than the disk whenever possible, write
  163. requests are always passed on to the prior interrupt handler.  Unlike most
  164. commercial caches, EMC110 doesn't try to avoid writing to disk by checking if
  165. the data to be written agrees with the cache contents.
  166.  
  167.      A cache performs like an automatic RAM-disk.  A cache is more convenient
  168. than a RAM-disk in that you don't have to copy files to it, you don't have to
  169. delete old files to make room for new ones, and you don't have to remember to
  170. copy updated files back to disk.  On the other hand, a cache is slower than a
  171. RAM-disk, and writing temporary files to disk is a waste of time.
  172.  
  173.      Both caches and RAM-disks provide increased performance by decreasing the
  174. time required to locate data (the seek time) and the time required to transfer
  175. it.  Whether there is a significant improvement in transfer time is highly
  176. system dependent; on a system with a slow processor and a fast disk system
  177. there may be no improvement at all.  But RAM-disks eliminate seek time
  178. entirely, and caches usually reduce it dramatically.  Whether there is a
  179. significant improvement in overall system performance depends on what you're
  180. doing.  If your primary activity is word-processing, all you'll get is a
  181. psychological lift from seeing the program load faster.  But for disk-intensive
  182. activities like sorting a huge fragmented database, the improvement should be
  183. significant and, if the files involved are too large to fit in a RAM-disk, a
  184. cache is your only choice.
  185.  
  186.      One factor in the performance of a cache is its size.  The smaller the
  187. cache the less likely it is that a read request can be serviced from the cache
  188. contents.  If the cache is too small, then the time spent copying each newly
  189. accessed sector into the cache (replacing previously accessed sectors) may
  190. exceed the time saved by occasionally finding the desired sector in the cache. 
  191. The result will be a degradation rather than an improvement in performance.  On
  192. the other hand, the larger the cache the longer it may take to find a sector in
  193. it.  Ideally the cache should be just large enough to contain all the sectors
  194. that are currently being accessed, but using an unnecessarily large cache is
  195. preferable to using one that is too small.
  196.  
  197.      As you use EMC110, you may find that the cache doesn't always contain
  198. everything that you think it should.  There are two reasons why such behavior
  199. may be consistent with correct operation of the program.  First, the cache may
  200. be too small.  Second, EMC110 organizes cached sectors into groups, and its
  201. response to any error or unexpected condition is to purge either the group
  202. involved or the entire cache.  So a disk error may result in seemingly
  203. unrelated sectors being purged from the cache, even though the sector causing
  204. the error may get into the cache on a retry.  Similarly, since EMC110 treats
  205. any request except read, write or status as an "unexpected condition", any such
  206. request will cause the entire cache to be purged.
  207.  
  208.  
  209. 10. Technical Notes.
  210.  
  211.      EMC110 works by intercepting calls to interrupt 13h.  It assumes that the
  212. calls it intercepts and passes on can be interpreted as calls to the IBM-XT
  213. hard disk BIOS, i.e., that the contents of the processor registers have the
  214. significance described in the IBM-XT Technical Reference Manual.  In particular
  215. it assumes that if the high bit of register DL is 1 then the call is directed
  216. to a hard disk.  It also makes three assumptions that are not explicit in the
  217. Technical Reference Manual description, namely that all hard disks have non-
  218. removable media, that all hard disks have 512-byte sectors, and that multi-
  219. sector requests are serviced by incrementing the sector number, the head number
  220. and the cylinder number, in that order.  If your system contains storage
  221. devices other than standard XT/AT hard disks and floppies, you must determine
  222. whether their operation involves interrupt 13h and, if so, whether the above
  223. assumptions are valid.  If they're not, the use of EMC110 will produce
  224. disastrous results.
  225.  
  226.      EMC110 also uses the drive-parameters subfunction (AH = 8) of interrupt
  227. 13h for two purposes of its own.  First, it uses this subfunction at
  228. installation time to determine how many sectors per track and how many heads
  229. each hard disk has; it will not cache hard disks which are not reported by this
  230. subfunction.  Second, communication with an installed copy of EMC110 is
  231. implemented in part by requesting parameters for a non-existent hard disk.  If
  232. EMC110 is not installed the result should be an error return.  If your hard-
  233. disk BIOS is willing to return parameters for a non-existent disk, no harm
  234. should be done; EMC110 will simply refuse to install itself.
  235.  
  236.      Except for this non-standard use of the drive-parameters subfunction,
  237. EMC110 expects requests for only three subfunctions of interrupt 13h: status
  238. request (AH = 1), read sectors (AH = 2), and write sectors (AH = 3).  A request
  239. for any other subfunction is handled by purging the cache and passing the
  240. request on.
  241.  
  242.      EMC110 is not re-entrant.  Its correct operation depends upon the fact
  243. that, since the IBM disk BIOS is not re-entrant, no operating system, multi-
  244. tasking program, or interrupt-driven program dare permit two concurrent calls
  245. to interrupt 13h.  This fact is also the reason for implementing communication
  246. with an installed copy of EMC110 by making non-standard use of interrupt 13h
  247. rather than by using a more respectable method.
  248.  
  249.  
  250. 11. Copyright, Disclaimer, etc.
  251.  
  252.      EMC110 is copyrighted by the author.  However, the author hereby grants
  253. permission for anyone to use this program, and to distribute it freely in
  254. unmodified form along with this documentation for no more than a nominal media
  255. charge. 
  256.  
  257.      The author makes no claim about this program except that he has done
  258. everything he could think of to ensure that it is error-free, and that he's
  259. using it himself.  If you use EMC110, you do so with the understanding that
  260. even the most carefully written program may contain subtle errors that appear
  261. only after prolonged use, that any resident program is subject to corruption by
  262. other ill-behaved programs, and that either of these eventualities could result
  263. in loss of data stored on your disks. 
  264.  
  265.      I'm interested in any comments and suggestions you have to make.  Even if
  266. you don't have any comments or suggestions, it's encouraging to hear from
  267. people who find EMC110 useful.  I'm also interested in reports of systems and
  268. software with which EMC110 doesn't work, but it's unlikely that I'll be able to
  269. help.  While you might be willing to send me copies of the software,
  270. duplicating your hardware would almost certainly be impossible.  I don't return
  271. long distance calls, but I do make an effort to answer all letters that require
  272. a reply.  Please address any correspondence to
  273.  
  274.                        Frank Lozier
  275.                        Department of Mathematics
  276.                        The Cleveland State University
  277.                        Euclid Avenue at East 24th Street
  278.                        Cleveland, Ohio 44115
  279.